package com.clps.digital.controller;

import cn.hutool.core.util.ObjectUtil;
import com.clps.digital.common.BaseResponse;
import com.clps.digital.common.ErrorCode;
import com.clps.digital.common.ResultUtils;
import com.clps.digital.model.entity.FirstPublish;
import com.clps.digital.model.vo.FirstPublishVo;
import com.clps.digital.service.FirstPublishService;

import java.util.List;

/**
 * @author: Chase
 * @date: 2024/9/3 15:32
 * @Version: 1.0
 * @description:
 */

public class FirstPublishController {

    private FirstPublishService firstPublishService;

    /**
     * 获取startup首发列表
     * @return
     */
    public BaseResponse<List<FirstPublishVo>> getFirstPublishList() {
        List<FirstPublishVo> firstPublishVoList = firstPublishService.getFirstPublishList();
        if (ObjectUtil.isEmpty(firstPublishVoList)) {
            return ResultUtils.error(ErrorCode.NOT_FOUND_ERROR, "获取startup首发列表失败");
        }
        return ResultUtils.success(firstPublishVoList);
    }
}
